package com.example.spring.jpa.test;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

/**
 * @author: orange
 * @create: 2023-08-03 16:50
 * @description:
 */
@Entity(name = "example")
@Setter
@Getter
@ToString
public class ExampleEntity {

    @Id
    @GenericGenerator(name = "jpa-uuid", strategy = "uuid")
    @GeneratedValue(generator = "jpa-uuid")
    @Column(columnDefinition = "varchar(50)")
    private String id;

    @Column(name = "ex_name", columnDefinition = "varchar(50)")
    private String name;

    @Column(name = "ex_age", columnDefinition = "INT")
    private Integer age;
}
